#include<iostream>
using namespace std;
bool hs(int i)
{
	int count = 1;
	if (i / 10 == 0)
	{
		if (i % 2 == 0)return false;
		else return true;
	}
	while (i / 10 != 0)
	{
		int j = i % 10;
		if (count % 2 != 0)
		{
			if (j % 2 == 0)return false;
		}
		else
		{
			if (j % 2 != 0)return false;
		}
		i /= 10;
		count++;
	}
	if (count % 2 == 0)
	{
		if (i % 2 != 0)return false;
	}
	else
	{
		if (i % 2 == 0)return false;
	}
	return true;
}
int main()
{
	int num = 0;
	int n;
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> n; 
	for (int i = 1; i <= n; i++)
	{
		if (hs(i))num++;
	}
	cout << num << endl;
	return 0;
}